import org.junit.Test;
import servlet.UserFinance;
import servlet.UserLogin;

public class test {
    @Test
    public void userLogin() throws Exception {
        System.out.println("登陆测试准备");
        UserLogin user = new UserLogin();
        System.out.println("username: " + "dai");
        System.out.println("password: " + "123456");
        user.userLogin("dai","123456");
        System.out.println("登陆测试完成");
    }

    @Test
    public void userLogin1() throws Exception {
        System.out.println("登陆测试准备");
        UserLogin user = new UserLogin();
        System.out.println("username: " + "dai");
        System.out.println("password: " + "666666");
        user.userLogin("dai","666666");
        System.out.println("登陆测试完成");
    }

    @Test
    public void moneyHistory() throws Exception{
        System.out.println("查看账户历史测试准备");
        UserFinance userFinance = new UserFinance();
        System.out.println("idNumber: " + "1");
        System.out.println("bool: " + "false");
        userFinance.moneyHistory("1",false);
        System.out.println("查看账户历史测试完成");
    }

    @Test
    public void addMoney() throws Exception{
        System.out.println("存钱测试准备");
        UserFinance userFinance = new UserFinance();
        System.out.println("idNumber: " + "1");
        System.out.println("money: " + "1000");
        userFinance.addMoney("1","1000");
        System.out.println("存钱测试完成");
    }

    @Test
    public void addMoney1() throws Exception{
        System.out.println("存钱测试准备");
        UserFinance userFinance = new UserFinance();
        System.out.println("idNumber: " + "1");
        System.out.println("money: " + "s");
        userFinance.addMoney("1","s");
        System.out.println("存钱测试完成");
    }

    @Test
    public void reduceMoney() throws Exception{
        System.out.println("取钱测试准备");
        UserFinance userFinance = new UserFinance();
        System.out.println("idNumber: " + "1");
        System.out.println("money: " + "600");
        userFinance.reduceMoney("1","600");
        System.out.println("取钱测试完成");
    }

    @Test
    public void reduceMoney1() throws Exception{
        System.out.println("取钱测试准备");
        UserFinance userFinance = new UserFinance();
        System.out.println("idNumber: " + "1");
        System.out.println("money: " + "s");
        userFinance.reduceMoney("1","s");
        System.out.println("取钱测试完成");
    }

}
